export default {
  // 用户编辑表单配置
  logForm: [
    {
      justify: 'space-between',
      columns: [
        {
          type: 'input',
          prop: 'userName',
          label: '用户名:',
          span: 11,
          placeholder: '请输入用户名',
          rules: [
            { required: true, message: '请输入用户名', trigger: 'blur' },
            { min: 3, max: 15, message: '长度在 3 到 15 个字符', trigger: 'blur' },
          ],
        },
        {
          type: 'select',
          prop: 'roleCode',
          label: '角色:',
          span: 11,
          placeholder: '请选择角色',
          options: [
            {
              value: 'ROLE_ADMIN',
              label: '系统管理员',
            },
            {
              value: 'ROLE_USER',
              label: '系统用户',
            },
          ],
          rules: [{ required: true, message: '请选择角色', trigger: 'change' }],
        },
      ],
    },

    {
      justify: 'space-between',
      columns: [
        {
          type: 'select',
          prop: 'status',
          label: '状态:',
          span: 11,
          placeholder: '请选择状态',
          options: [
            {
              value: 1,
              label: '启用',
            },
            {
              value: 0,
              label: '禁用',
            },
          ],
          rules: [{ required: true, message: '请选择状态', trigger: 'change' }],
        },
      ],
    },

    // {
    //   "justify": "space-between",
    //   "columns": [
    //     {
    //       type: 'upload',
    //       prop: 'avatar',
    //       label: '头像',
    //       buttonText: '上传头像',
    //       accept: 'image/*',
    //       limit: 1,
    //       span: 11,
    //       useInputSlot: true,
    //       rules: [
    //         { required: true, message: '请上传头像', trigger: 'change' }
    //       ]
    //     },

    //   ]
    // },
    {
      columns: [
        {
          type: 'textarea',
          prop: 'remarks',
          label: '备注:',
          placeholder: '请输入备注',
          rows: 4,
          rules: [{ max: 200, message: '备注长度不能超过200个字符', trigger: 'blur' }],
        },
      ],
    },
  ],
  // 查询表单
  searchoperform: [
    {
      type: 'input',
      value: 'opAddr',
      name: '操作地址',
      placeholder: '请输入内容',
    },
    {
      type: 'input',
      value: 'sysModule',
      name: '系统模块',
      placeholder: '请输入内容',
    },
    {
      type: 'input',
      value: 'operator',
      name: '操作人员',
      placeholder: '请输入内容',
    },
    {
      type: 'select',
      value: 'opType',
      name: '操作类型',
      placeholder: '请选择',
      options: [
        {
          value: '编辑',
          label: '编辑',
        },
        {
          value: '新增',
          label: '新增',
        },
        {
          value: '删除',
          label: '删除',
        },
        {
          value: '查询',
          label: '查询',
        },
      ],
    },
    {
      type: 'select',
      value: 'opStatus',
      name: '操作状态',
      placeholder: '请选择',
      options: [
        {
          value: '成功',
          label: '成功',
        },
        {
          value: '失败',
          label: '失败',
        },
      ],
    },
  ],

  searchoper: {
    opAddr: '',
    sysModule: '',
    operator: '',
    opStatus: '',
    opType: '',
  },

  searchloginform: [
    {
      type: 'input',
      value: 'opAddr',
      name: '登录地址',
      placeholder: '请输入内容',
    },
    {
      type: 'input',
      value: 'userName',
      name: '用户名称',
      placeholder: '请输入内容',
    },
    {
      type: 'select',
      value: 'loginStatus',
      name: '状态',
      placeholder: '请选择',
      options: [
        {
          value: '成功',
          label: '成功',
        },
        {
          value: '失败',
          label: '失败',
        },
      ],
    },
    {
      type: 'times',
      value: 'playTime',
      name: '登录时间',
      placeholder: '请选择时间',
    },
  ],

  searchlogin: {
    opAddr: '',
    userName: '',
    loginStatus: '',
    playTime: [],
  },

  // 演示表单配置
  demoForm: [
    {
      // 第一行：输入框示例
      columns: [
        {
          type: 'input',
          prop: 'username',
          label: '用户名',
          placeholder: '请输入用户名',
          span: 12,
          rules: [
            { required: true, message: '请输入用户名', trigger: 'blur' },
            { min: 3, max: 15, message: '长度在 3 到 15 个字符', trigger: 'blur' },
          ],
        },
        {
          type: 'input',
          prop: 'email',
          label: '邮箱',
          placeholder: '请输入邮箱地址',
          span: 12,
          rules: [
            { required: true, message: '请输入邮箱地址', trigger: 'blur' },
            { type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' },
          ],
        },
      ],
    },
    {
      // 第二行：密码输入框示例
      columns: [
        {
          type: 'input',
          prop: 'password',
          label: '密码',
          placeholder: '请输入密码',
          inputType: 'password',
          showPassword: true,
          span: 12,
          rules: [
            { required: true, message: '请输入密码', trigger: 'blur' },
            { min: 6, message: '密码长度至少6位', trigger: 'blur' },
          ],
        },
        {
          type: 'input',
          prop: 'confirmPassword',
          label: '确认密码',
          placeholder: '请再次输入密码',
          inputType: 'password',
          showPassword: true,
          span: 12,
          rules: [{ required: true, message: '请再次输入密码', trigger: 'blur' }],
        },
      ],
    },
    {
      // 第三行：文本域示例
      columns: [
        {
          type: 'textarea',
          prop: 'description',
          label: '描述',
          placeholder: '请输入描述信息',
          rows: 4,
          span: 24,
          rules: [{ required: true, message: '请输入描述信息', trigger: 'blur' }],
        },
      ],
    },
    {
      // 第四行：选择器示例
      columns: [
        {
          type: 'select',
          prop: 'gender',
          label: '性别',
          placeholder: '请选择性别',
          span: 12,
          options: [
            { value: 'male', label: '男' },
            { value: 'female', label: '女' },
            { value: 'other', label: '其他' },
          ],
          rules: [{ required: true, message: '请选择性别', trigger: 'change' }],
        },
        {
          type: 'select',
          prop: 'hobbies',
          label: '爱好',
          placeholder: '请选择爱好',
          multiple: true,
          span: 12,
          options: [
            { value: 'reading', label: '阅读' },
            { value: 'music', label: '音乐' },
            { value: 'sports', label: '运动' },
            { value: 'travel', label: '旅行' },
          ],
        },
      ],
    },
    {
      // 第五行：日期选择器示例
      columns: [
        {
          type: 'daterange',
          prop: 'birthday',
          label: '生日',
          placeholder: '请选择生日',
          dateType: 'date',
          format: 'YYYY-MM-DD',
          valueFormat: 'YYYY-MM-DD',
          span: 12,
          rules: [{ required: true, message: '请选择生日', trigger: 'change' }],
        },
        {
          type: 'date',
          prop: 'appointment',
          label: '预约时间',
          placeholder: '请选择预约时间',
          dateType: 'datetime',
          format: 'YYYY-MM-DD HH:mm:ss',
          valueFormat: 'YYYY-MM-DD HH:mm:ss',
          span: 12,
        },
      ],
    },
    {
      // 第六行：文件上传示例
      columns: [
        {
          type: 'upload',
          prop: 'avatar',
          label: '头像',
          buttonText: '上传头像',
          action: '/api/upload/avatar',
          accept: 'image/*',
          limit: 1,
          span: 12,
          rules: [{ required: true, message: '请上传头像', trigger: 'change' }],
        },
        {
          type: 'upload',
          prop: 'documents',
          label: '文档',
          buttonText: '上传文档',
          action: '/api/upload/documents',
          accept: '.pdf,.doc,.docx',
          multiple: true,
          span: 12,
        },
      ],
    },
    {
      // 第七行：自定义插槽示例
      columns: [
        {
          type: 'slot',
          prop: 'customField',
          label: '自定义字段',
          slotName: 'customField',
          span: 24,
        },
      ],
    },
  ],
}
